package com.radiant.exceptions;

import javax.ws.rs.core.Response;
import javax.ws.rs.ext.ExceptionMapper;
import javax.ws.rs.ext.Provider;

@Provider
public class AuthenticationExceptionMapper implements ExceptionMapper<RadiantAuthenticationException> {
	
	public Response toResponse(RadiantAuthenticationException ex) {
		return Response.status(401).
				entity(ex.getMessage()).
				type("text/plain").build();
	}
}